<!DOCTYPE html>
<html lang="">

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width,initial-scale=1.0">
  <link rel="icon" href="<%= BASE_URL %>favicon.ico">
  <title>
    湘裳的网页
  </title>
</head>
<script>
  setInterval(function () {
    check()
    console.clear()
  }, 1000);
  var check = function () {
    function doCheck(a) {
      if (("" + a / a)["length"] !== 1 || a % 20 === 0) {
        (function () { }
        ["constructor"]("debugger")())
      } else {
        (function () { }
        ["constructor"]("debugger")())
      }
      doCheck(++a)
    }
    try {
      doCheck(0)
    } catch (err) { }
  };
  check();
  function redirectToBlank() {
    window.location.href = 'about:blank';
  }
  window.onblur = function () {
    redirectToBlank();
  };
</script>

<body id="body">
  <script>
    let cw = 1800, ch = 920
    let body = document.getElementById('body')
    body.style.width = `${cw}px`
    body.style.height = `${ch}px`
    // 对body进行缩放
    function windowResize() {
      // 窗口宽高
      let w = window.innerWidth, h = window.innerHeight
      //窗口最小宽高度
      if (w < 950) {
        w = 950;
      }
      if (h < 480) {
        h = 480;
      }
      // 缩放比例
      let r = w / cw < h / ch ? w / cw : h / ch
      body.style.transform = `scale( ${r})`
      // 因为scale是以body的原中心点为基准进行缩放，所以缩放之后需要调整外边距，使其位于窗口的中心位置
      body.style.marginLeft = (-(cw - r * cw) / 2 + (w - r * cw) / 2) + 'px'
      body.style.marginTop = (-(ch - r * ch) / 2 + (h - r * ch) / 2) + 'px'
      body.style.marginBottom = (-(h > ch ? h : ch - r * ch)) + 'px'
      body.style.marginRight = (-(w > cw ? w : cw - r * cw)) + 'px'
    }
    windowResize()
    // 监听窗口尺寸变化
    window.addEventListener('resize', windowResize);
  </script>
  <noscript>
    <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled.
        Please enable it to continue.</strong>
  </noscript>
  <div id="app"></div>
  <style>
    #body {
      width: 100%;
      height: 100%;
    }

    * {
      padding: 0;
      margin: 0;
    }
  </style>

</body>

</html>